package com.smh.a01CollectionDemo1;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;

public class CollectionDemo1 {
    public static void main(String[] args) {

        Collection<String> collection = new ArrayList<>();

        //add
        collection.add("1231");
        collection.add("1231");
        System.out.println(collection.add("1231"));
        System.out.println(collection);
        //remove
        collection.remove("1231");
        System.out.println(collection);
        //contains
        System.out.println(collection.contains("1231"));
        //clear
        collection.clear();
        System.out.println(collection);
        //size
        System.out.println(collection.size());


        System.out.println("--------------------------");
        Collection<String> collection1 = new HashSet<>();

        System.out.println(collection1.add("sadda"));
        System.out.println(collection1.add("sadda"));
        System.out.println(collection1);


    }
}
